#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# Project: blogsite
#  Author: an00
#  Create: 2018/4/5 11:42


from django.conf.urls import url
from django.views.decorators.cache import cache_page
from blog import views
from blog.feeds import AllArticleRssFeed


app_name = 'blog'
urlpatterns = [
    url(r'^$', views.IndexView.as_view()),
    url(r'^index', views.IndexView.as_view(), name='index'),
    url(r'^category/(?P<pk>\d+)', views.CategoryView.as_view(), name='category'),
    url(r'^detail/(?P<pk>\d+).html', cache_page(60 * 60)(views.ArticleDetailView.as_view()), name='detail'),
    url(r'^tag/(?P<pk>\d+)', views.TagView.as_view(), name='tag'),
    url(r'^archive/(?P<year>[0-9]{4})/(?P<month>[0-9]{1,2})', views.TimeArchiveView.as_view(), name='archive'),
    url(r'^search$', views.search, name='search'),
    url(r'^about', views.about, name='about'),
    url(r'all/rss$', AllArticleRssFeed(), name='rss'),
]
